<!--
* @description 添加设备
* @author zywu
* @date 2021/03/15 15:26:03
!-->
<template>
  <div class="page" data-page="reportApplyDetail" style="z-index: 2;">
    <div class="page-content" id="vueIframe_content" style="overflow: hidden; height: 100%;">
      <iframe id="vueIframe" src="" style="width: 100%; height: 100%; border: none;"></iframe>
    </div>
  </div>
</template>
<script>
  return {
    data: function () {
      return {
        qRcode: ''
      }
    },
    methods: {
      showDetail: function () {
        var self = this
        self.url = `${staticPathVue}#/AddDevice`;
        $("#vueIframe").attr("src", self.url);
      },
      //原生扫一扫回调
      scanningreciviceLocation: function (qRcode) {
        var self = this;
        self.qRcode = qRcode
        window.parent.document.getElementById('vueIframe').contentWindow.getQode(qRcode)
      },
    },
    on: {
      pageInit: function () {
        var self = this;
        self.showDetail()
        window.goDeviceDetail=(data)=>{
          if(data){
            localStorage.setItem("equipment_material",JSON.stringify(data))
            app.router.navigate(`/eqmentMsg/` + data.fcFacilitiesId + `/`);
          }
        }
      },
      pageAfterOut: function (e, page) {

      },
    },
  }
</script>